<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>发布求购</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../elementUI/index.css">
    <link rel="stylesheet" href="../../../css/index.css">
</head>

<body>
    <div id="app" class="minWidth">
        <el-form :model="form" :rules="rules" ref="form" inline-message="true" style="width: 100%">
            <div class="table_titel">
                <div class="titel">商品信息</div>
            </div>
            <el-descriptions :column="3" border size="small">
                <el-descriptions-item label="商品名称">
                    <el-form-item prop="Article_Name">
                        <el-input clearable style="width: 250px;" v-model="form.Article_Name"
                            placeholder="请输入商品名称"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="挂单标题">
                    <el-form-item prop="title">
                        <el-input clearable style="width: 250px;" v-model.number="form.Group_Seek_Purchase_Name"
                            placeholder="请输入标题"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="定价(例:100/吨)">
                    <el-form-item prop="Unit_Quantity">
                        <div style="display: flex;">
                            <el-input clearable style="width: 250px;" v-model.number="form.Unit_Quantity"
                                placeholder="请输入商品单位数量"></el-input>
                            <el-select clearable v-model="form.Article_Unit_SerialNumber" placeholder="请选择单位">
                                <el-option v-for="(item,i) in unit" :key="i" :label="item.Unit"
                                    :value="item.Article_Unit_SerialNumber">
                                </el-option>
                            </el-select>
                        </div>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="商品价格">
                    <el-form-item prop="Amount">
                        <el-input clearable style="width: 250px;" v-model.number="form.Amount"
                            placeholder="请输入商品价格"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="需求商品数量">
                    <el-form-item prop="Total_Quantity">
                        <el-input clearable v-model.number="form.Total_Quantity" placeholder="请输入全部商品数量"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="最低买入商品数量">
                    <el-form-item prop="Starting_Quantity">
                        <el-input clearable v-model.number="form.Starting_Quantity"
                            placeholder="请输入最低一次购买商品数量"></el-input>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>
            <div class="table_titel">
                <div class="titel">联系人信息</div>
            </div>
            <el-descriptions :column="4" border size="small">
                <el-descriptions-item label="联系人">
                    <el-form-item prop="Contacts">
                        <el-input :maxlength="10" :maxlength="1" clearable v-model.trim="form.Contacts"
                            placeholder="请输入联系人"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="联系人电话">
                    <el-form-item prop="Contacts_Phone">
                        <el-input maxlength="11" clearable v-model.number="form.Contacts_Phone"
                            placeholder="请输入联系人电话"></el-input>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>
            <div class="table_titel">
                <div class="titel">保证金方式</div>
            </div>
            <el-form-item label="保证方式:">
                <el-radio v-model="form.Guarantee_Method" label="1">保证金</el-radio>
            </el-form-item>
            <div class="table_titel">
                <div class="titel">是否展示</div>
            </div>
            <el-descriptions :column="2" border size="small">
                </el-descriptions-item>
                <el-descriptions-item label="是否公布">
                    <el-form-item prop="Outstation_Formula">
                        <el-select clearable v-model="form.Outstation_Formula" placeholder="是否公布在全部求购">
                            <el-option v-for="(item,i) in ispublish" :key="i" :label="item.name" :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="补充约定(非必填)">
                    <el-form-item prop="Supplementary_Explanation">
                        <el-input v-model.trim="form.Supplementary_Explanation" placeholder="请输入补充约定"></el-input>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>
            <el-form-item class="form-operation" style="z-index: 999;">
                <el-button @click="window.history.back()">返回</el-button>
                <el-button type="primary" :loading="loading" @click="submitForm('form')">提交</el-button>
            </el-form-item>
        </el-form>
        <el-form :model="form.Children" :rules="rules2" ref="form.Children" inline-message="true"
            style="width: 100%;margin-bottom: 100px;">
            <div class="table_titel">
                <div class="titel">交收方式</div>
            </div>
            <el-descriptions :column="3" border size="small">
                <el-descriptions-item label="质量验收方式">
                    <el-form-item>
                        <el-select clearable v-model="form.Quality_Acceptance_SerialNumber" placeholder="请选择您支持的质量验收方式">
                            <el-option v-for="(item,i) in QualityInspection" :key="i"
                                :label="item.Quality_Acceptance_Name" :value="item.Quality_Acceptance_SerialNumber">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="数量验收方式">
                    <el-form-item>
                        <el-select collapse-tags clearable v-model="form.Quantity_Acceptance_SerialNumber"
                            placeholder="请选择您支持的数量验收方式">
                            <el-option v-for="(item,i) in QuantityInspection" :key="i"
                                :label="item.Quantity_Acceptance_Name" :value="item.Quantity_Acceptance_SerialNumber">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="请选择交收方式">
                    <el-form-item>
                        <el-radio v-model="form.Delivery_Method" label="1">正常交收</el-radio>
                        <el-radio v-model="form.Delivery_Method" label="2">协议交收</el-radio>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="打款方式(可多选)">
                    <el-form-item prop="group_seek_purchase_payment">
                        <el-select multiple collapse-tags clearable v-model="form.Children.group_seek_purchase_payment"
                            placeholder="请选择您支持的打款方式">
                            <el-option v-for="(item,i) in Paymentmethod" :key="i" :label="item.Payment_Name"
                                :value="item.Payment_SerialNumber">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="装运方式(可多选)">
                    <el-form-item prop="group_seek_purchase_shipment">
                        <el-select multiple collapse-tags clearable v-model="form.Children.group_seek_purchase_shipment"
                            placeholder="请选择您支持的装运方式">
                            <el-option v-for="(item,i) in Shippingmethod" :key="i" :label="item.Shipment_Name"
                                :value="item.Shipment_SerialNumber">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="运输方式(可多选)">
                    <el-form-item prop="group_seek_purchase_transport">
                        <el-select multiple collapse-tags clearable
                            v-model="form.Children.group_seek_purchase_transport" placeholder="请选择您支持的运输方式">
                            <el-option v-for="(item,i) in transportationmethod" :key="i" :label="item.Transport_Name"
                                :value="item.Transport_SerialNumber">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="付款周期">
                    <el-form-item>
                        <el-select @change="changePayWay" collapse-tags clearable v-model="form.Trading_SerialNumber"
                            placeholder="请选择您支持的付款周期">
                            <el-option v-for="(item,i) in Payoutcycle" :key="i" :label="item.Trading_Name"
                                :value="item.Trading_SerialNumber">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="货品质量特殊条款">
                    <el-form-item>
                        <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="form.Supplementary_Provisions">
                        </el-input>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>
        </el-form>
        <div v-if="payway=='T00000000000002'" style="margin-bottom: 200px;">
            <div class="table_titel"
                style="display: flex;justify-content: space-between;align-items: center;margin: 20px 0;">
                <div class="titel">按步骤付款方式细则</div>
                <div style="display: flex;">
                    <el-button type="primary" @click="add()">新增</el-button>
                    <el-button type="danger" @click="rdc()">删除</el-button>
                </div>
            </div>
            <el-descriptions v-for="(item,i) in Payment_cycle_details" :key="i" :column="3" border size="small">
                <el-descriptions-item :label="`按条件付款第${i+1}阶段`">
                    <el-input placeholder="请输入内容" v-model="item.PaymentCycleStage">
                    </el-input>
                </el-descriptions-item>
                <el-descriptions-item label="按条件付款额度">
                    <div style="display: flex;align-items: center;">
                        <el-input placeholder="请输入内容" v-model="item.PaymentCycleAmount">
                        </el-input>
                        <span>%</span>
                    </div>
                </el-descriptions-item>
                <el-descriptions-item label="最晚按条件付款时间">
                    <div style="display: flex;align-items: center;">
                        <el-select @change="changeFktype($event,i,item)" v-model="item.PaymentCycleType"
                            placeholder="请选择">
                            <el-option
                                v-for="item_ in item.fkzqxz.filter(item=>!isArr.some(id=>id.id==item.Trading_Detail_SerialNumber&&id.index!=i))"
                                :key="item_.Trading_Detail_SerialNumber" :label="item_.Trading_Detail_Name"
                                :value="item_.Trading_Detail_SerialNumber">
                            </el-option>
                        </el-select>
                        <el-input-number v-model="item.PaymentCycleLastTime" :min="1"></el-input-number>
                    </div>
                </el-descriptions-item>
            </el-descriptions>
        </div>
        <div v-if="payway=='T00000000000001'" style="margin-bottom: 200px;">
            <div class="table_titel">
                <div class="titel">全额付款方式细则</div>
            </div>
            <el-select v-model="fkzqxz2.jd" placeholder="请选择">
                <el-option v-for="item in AllPayWay" :key="item.Trading_Detail_SerialNumber"
                    :label="item.Trading_Detail_Name" :value="item.Trading_Detail_SerialNumber">
                </el-option>
            </el-select>
            <el-input-number v-model="fkzqxz2.date" :min="1"></el-input-number>
            <span>天后</span>
        </div>
    </div>
    <script type="text/javascript" src="../../../js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="../../../js/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../js/vue.min.js"></script>
    <script type="text/javascript" src="../../../elementUI/index.js"></script>
    <script type="text/javascript" src="../../../js/utils.js"></script>
    <script type="text/javascript" src="../../../js/ID_Validity.js"></script>
    <script type="text/javascript" src="../../../js/compressor.js"></script>
    <script type="text/javascript" src="../../../js/FileSaver.min.js"></script>
    <script type="text/javascript" src="../../../js/FileSaver.js"></script>
    <script type="text/javascript" src="../../../js/xlsx.full.min.js"></script>
    <script type="text/javascript" src="./js/Add.js"></script>
</body>

</html>